package com.race.entities.po;

import com.race.entities.po.Base.AbstractEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import java.util.Set;

/**
 * @author xc
 */
@Getter
@Setter
@Entity
public class Permission extends AbstractEntity {
    /**
     * 权限名称
     */
    private String name;
    /**
     * 接口路径
     */
    private String url;
    /**
     * 权限----角色
     */
    @ManyToMany
    @JoinTable(joinColumns = {@JoinColumn(name = "pid")},
                inverseJoinColumns = {@JoinColumn(name = "rid")})
    private Set<Role> roles;
}
